using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
	
    public class SSRFCNDInfo
    {
		#region Local Variable
		public enum Field
		{
			SUN_DB,
			CODE,
			CONV_DATE,
			FROM_ACCT,
			TO_ACCT,
			LOOKUP,
			UPDATED,
			NAME,
			OPERATOR,
			RATE,
			DEC_PLACES,
			NET_ACCT_REAL,
			LOSS_ACCT_REAL,
			GAIN_ACCT_REAL,
			EURO_RATE
		}
		private String _SUN_DB;
		private String _CODE;
		private Int32 _CONV_DATE;
		private String _FROM_ACCT;
		private String _TO_ACCT;
		private String _LOOKUP;
		private String _UPDATED;
		private String _NAME;
		private String _OPERATOR;
		private Decimal _RATE;
		private String _DEC_PLACES;
		private String _NET_ACCT_REAL;
		private String _LOSS_ACCT_REAL;
		private String _GAIN_ACCT_REAL;
		private Decimal _EURO_RATE;
		
		public String SUN_DB{	get{ return _SUN_DB;} set{_SUN_DB = value;} }
		public String CODE{	get{ return _CODE;} set{_CODE = value;} }
		public Int32 CONV_DATE{	get{ return _CONV_DATE;} set{_CONV_DATE = value;} }
		public String FROM_ACCT{	get{ return _FROM_ACCT;} set{_FROM_ACCT = value;} }
		public String TO_ACCT{	get{ return _TO_ACCT;} set{_TO_ACCT = value;} }
		public String LOOKUP{	get{ return _LOOKUP;} set{_LOOKUP = value;} }
		public String UPDATED{	get{ return _UPDATED;} set{_UPDATED = value;} }
		public String NAME{	get{ return _NAME;} set{_NAME = value;} }
		public String OPERATOR{	get{ return _OPERATOR;} set{_OPERATOR = value;} }
		public Decimal RATE{	get{ return _RATE;} set{_RATE = value;} }
		public String DEC_PLACES{	get{ return _DEC_PLACES;} set{_DEC_PLACES = value;} }
		public String NET_ACCT_REAL{	get{ return _NET_ACCT_REAL;} set{_NET_ACCT_REAL = value;} }
		public String LOSS_ACCT_REAL{	get{ return _LOSS_ACCT_REAL;} set{_LOSS_ACCT_REAL = value;} }
		public String GAIN_ACCT_REAL{	get{ return _GAIN_ACCT_REAL;} set{_GAIN_ACCT_REAL = value;} }
		public Decimal EURO_RATE{	get{ return _EURO_RATE;} set{_EURO_RATE = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public SSRFCNDInfo()
		{
			_SUN_DB = "";
			_CODE = "";
			_CONV_DATE = 0;
			_FROM_ACCT = "";
			_TO_ACCT = "";
			_LOOKUP = "";
			_UPDATED = "";
			_NAME = "";
			_OPERATOR = "";
			_RATE = 0;
			_DEC_PLACES = "";
			_NET_ACCT_REAL = "";
			_LOSS_ACCT_REAL = "";
			_GAIN_ACCT_REAL = "";
			_EURO_RATE = 0;
		}
		public SSRFCNDInfo(
		String SUN_DB,
		String CODE,
		Int32 CONV_DATE,
		String FROM_ACCT,
		String TO_ACCT,
		String LOOKUP,
		String UPDATED,
		String NAME,
		String OPERATOR,
		Decimal RATE,
		String DEC_PLACES,
		String NET_ACCT_REAL,
		String LOSS_ACCT_REAL,
		String GAIN_ACCT_REAL,
		Decimal EURO_RATE
		)
		{
			_SUN_DB = SUN_DB;
			_CODE = CODE;
			_CONV_DATE = CONV_DATE;
			_FROM_ACCT = FROM_ACCT;
			_TO_ACCT = TO_ACCT;
			_LOOKUP = LOOKUP;
			_UPDATED = UPDATED;
			_NAME = NAME;
			_OPERATOR = OPERATOR;
			_RATE = RATE;
			_DEC_PLACES = DEC_PLACES;
			_NET_ACCT_REAL = NET_ACCT_REAL;
			_LOSS_ACCT_REAL = LOSS_ACCT_REAL;
			_GAIN_ACCT_REAL = GAIN_ACCT_REAL;
			_EURO_RATE = EURO_RATE;
		}
		public SSRFCNDInfo(DataRow dr)
		{
			if (dr != null)
			{
				_SUN_DB = dr[Field.SUN_DB.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.SUN_DB.ToString()]);
				_CODE = dr[Field.CODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CODE.ToString()]);
				_CONV_DATE = dr[Field.CONV_DATE.ToString()] == DBNull.Value?0:Convert.ToInt32(dr[Field.CONV_DATE.ToString()]);
				_FROM_ACCT = dr[Field.FROM_ACCT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.FROM_ACCT.ToString()]);
				_TO_ACCT = dr[Field.TO_ACCT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.TO_ACCT.ToString()]);
				_LOOKUP = dr[Field.LOOKUP.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOOKUP.ToString()]);
				_UPDATED = dr[Field.UPDATED.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.UPDATED.ToString()]);
				_NAME = dr[Field.NAME.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.NAME.ToString()]);
				_OPERATOR = dr[Field.OPERATOR.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.OPERATOR.ToString()]);
				_RATE = dr[Field.RATE.ToString()] == DBNull.Value?0:Convert.ToDecimal(dr[Field.RATE.ToString()]);
				_DEC_PLACES = dr[Field.DEC_PLACES.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DEC_PLACES.ToString()]);
				_NET_ACCT_REAL = dr[Field.NET_ACCT_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.NET_ACCT_REAL.ToString()]);
				_LOSS_ACCT_REAL = dr[Field.LOSS_ACCT_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOSS_ACCT_REAL.ToString()]);
				_GAIN_ACCT_REAL = dr[Field.GAIN_ACCT_REAL.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.GAIN_ACCT_REAL.ToString()]);
				_EURO_RATE = dr[Field.EURO_RATE.ToString()] == DBNull.Value?0:Convert.ToDecimal(dr[Field.EURO_RATE.ToString()]);
			}
		}
		public SSRFCNDInfo(SSRFCNDInfo objEntr)
		{			
			_SUN_DB = objEntr.SUN_DB;			
			_CODE = objEntr.CODE;			
			_CONV_DATE = objEntr.CONV_DATE;			
			_FROM_ACCT = objEntr.FROM_ACCT;			
			_TO_ACCT = objEntr.TO_ACCT;			
			_LOOKUP = objEntr.LOOKUP;			
			_UPDATED = objEntr.UPDATED;			
			_NAME = objEntr.NAME;			
			_OPERATOR = objEntr.OPERATOR;			
			_RATE = objEntr.RATE;			
			_DEC_PLACES = objEntr.DEC_PLACES;			
			_NET_ACCT_REAL = objEntr.NET_ACCT_REAL;			
			_LOSS_ACCT_REAL = objEntr.LOSS_ACCT_REAL;			
			_GAIN_ACCT_REAL = objEntr.GAIN_ACCT_REAL;			
			_EURO_RATE = objEntr.EURO_RATE;			
		}
        #endregion Constructor
        
        #region InitTable
		public DataTable ToDataTable()
		{
			DataTable dt = new DataTable("SSRFCND");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.SUN_DB.ToString(), typeof(String)),
				new DataColumn(Field.CODE.ToString(), typeof(String)),
				new DataColumn(Field.CONV_DATE.ToString(), typeof(Int32)),
				new DataColumn(Field.FROM_ACCT.ToString(), typeof(String)),
				new DataColumn(Field.TO_ACCT.ToString(), typeof(String)),
				new DataColumn(Field.LOOKUP.ToString(), typeof(String)),
				new DataColumn(Field.UPDATED.ToString(), typeof(String)),
				new DataColumn(Field.NAME.ToString(), typeof(String)),
				new DataColumn(Field.OPERATOR.ToString(), typeof(String)),
				new DataColumn(Field.RATE.ToString(), typeof(Decimal)),
				new DataColumn(Field.DEC_PLACES.ToString(), typeof(String)),
				new DataColumn(Field.NET_ACCT_REAL.ToString(), typeof(String)),
				new DataColumn(Field.LOSS_ACCT_REAL.ToString(), typeof(String)),
				new DataColumn(Field.GAIN_ACCT_REAL.ToString(), typeof(String)),
				new DataColumn(Field.EURO_RATE.ToString(), typeof(Decimal))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.SUN_DB.ToString()] = _SUN_DB;
			row[Field.CODE.ToString()] = _CODE;
			row[Field.CONV_DATE.ToString()] = _CONV_DATE;
			row[Field.FROM_ACCT.ToString()] = _FROM_ACCT;
			row[Field.TO_ACCT.ToString()] = _TO_ACCT;
			row[Field.LOOKUP.ToString()] = _LOOKUP;
			row[Field.UPDATED.ToString()] = _UPDATED;
			row[Field.NAME.ToString()] = _NAME;
			row[Field.OPERATOR.ToString()] = _OPERATOR;
			row[Field.RATE.ToString()] = _RATE;
			row[Field.DEC_PLACES.ToString()] = _DEC_PLACES;
			row[Field.NET_ACCT_REAL.ToString()] = _NET_ACCT_REAL;
			row[Field.LOSS_ACCT_REAL.ToString()] = _LOSS_ACCT_REAL;
			row[Field.GAIN_ACCT_REAL.ToString()] = _GAIN_ACCT_REAL;
			row[Field.EURO_RATE.ToString()] = _EURO_RATE;
			return row;
		}
        #endregion InitTable
    }
}
